home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 September
/
1985-09.d64
/
friendly alien
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
170 lines
5 rem*c64friendlyalien
6 goto20
7 print"time: ";mid$(ti$,3,2);":";right$(ti$,2)
8 ifti$>tu$thenprint"time is up!!! ":fori=1to1500:next:goto1300
10 return
11 lo=lo-q2:return
12 lo=lo-q1:return
13 lo=lo+p:return
14 lo=lo+q3:return
15 lo=lo+q2:return
16 lo=lo+q1:return
17 lo=lo-p:return
18 lo=lo-q3:return
20 poke56,48:poke52,48:clr
30 poke53281,1:print"[147] *****friendly alien*****[146]
35 [153]" stopsetting up...."
36 [151]56334,[194](56334)[175]254:[151]1,[194](1)[175]251
40 nm[178]12288:[129]i[178]nm[164]nm[170]511:[151]i,[194](i[170]40960):[130]
42 [129]i[178]0[164]7:[151]nm[170]8[172]59[170]i,[194](53248[170]81[172]8[170]i):[130]:[151]nm[170]8[172]59[170]3,255
44 [129]i[178]0[164]7:[151]nm[170]8[172]61[170]i,[194](53248[170]8[172]77[170]i):[130]
48 [151]1,[194](1)[176]4:[151]56334,[194](56334)[176]1:ck[178]0
50 [129]i[178]nm[170]272[164]nm[170]311:[135]a:ck[178]ck[170]a:[151]i,a:[130]
58 [129]i[178]nm[170]344[164]nm[170]383:[135]a:ck[178]ck[170]a:[151]i,a:[130]
68 [129]i[178]0[164]31:[135]a:ck[178]ck[170]a:[151]nm[170]i,a:[130]
69 [129]i[178]0[164]7:[135]a:ck[178]ck[170]a:[151]nm[170]8[172]60[170]i,a:[130]
70 [139]ck[178]15391[167]100
71 [153]"**error in data statements**":[153]"**check lines 8070-8093**":[128]
100 x[178][187]([171]ti):[151]53280,0:[151]53281,0
101 [153]"loadguide the little alien with a joystick in port 2";
110 [153]" and pick up all the candy.
135 print:print"then guide him to the phone and then to the spaceship.
160 [153]:[153]"syslook out for the cans of cola.";
161 [153]" if he drinks cola he will have an allergic";
165 [153]" reaction and can't be guided.
168 print:print"[159]if he touches a flu bug, ";
169 print"or if you run out of time, he will get the flu and cannot go home.
170 [153]"list***you have 2 minutes***
500 print"enter skill level 1-5[146]":poke198,0
502 geta$:ifa$=""then502
503 a=val(a$):ifa<1ora>5then500
505 sc=1024
510 cm=54272:print"[147]":poke53280,14:poke53281,1:p5=15
511 o=0:h1=1:h2=32:h3=3:h4=34:h5=35:h6=36:h7=42:h8=61:h9=2:p6=45:p7=46:p8=47
512 vl=54296:sl=54272:sh=54273:wf=54276:q1=39:q2=40:q3=41:q4=42::p1=56320:p=1
515 poke53272,(peek(53272)and240)+12:pokesl+5,17:pokesl+6,241
519 rem: ***build border
520 forb=sc+q2tosc+80:pokeb,35:pokecm+b,6:next
525 forb=sc+79tosc+999stepq2:pokeb,35:pokecm+b,6:next
530 forb=sc+998tosc+960step-1:pokeb,35:pokecm+b,6:next
535 forb=sc+960tosc+q2step-q2:pokeb,35:pokecm+b,6:next
600 rem: ***place flubugs
605 fori=1to9*a
610 gosub4000
612 ifpeek(x)=35then610
620 pokex,42:pokecm+x,3:ifi<=athenf(i)=x:pokex+cm,7
622 next
700 rem: ***place cola
705 fori=1to15*a
710 gosub4000
720 ifpeek(x)=35orpeek(x)=42orpeek(x-q2)=36orpeek(x+q2)=36then710
725 pokex,36:pokecm+x,2:next
800 rem: ***place candy
803 c=2:fori=1to20:c=c+1:ifc>7thenc=2
810 gosub4000
820 ifpeek(x)<>32orpeek(x+1)<>32orpeek(x-1)<>32orpeek(x+q2)<>32then810
822 ifpeek(x-q2)<>32then810
825 pokex,34:pokecm+x,c:next
830 rp=20:lo=sc+918:ti$="000000":tu$="000159"
899 rem: ***main loop
900 ifrp=.then3000
920 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
922 gosub7
930 pokesh,50:pokevl,10:pokewf,17:goto1500
935 pokewf,16
1000 aa=p5-(peek(p1)andp5)
1050 lt=lo:onaagosub11,15,10,17,18,16,10,13,12,14
1080 pokelt,h2:pokelt+q2,h2
1099 rem: ***collision checker
1100 tl=peek(lo):bl=peek(lo+q2)
1102 iftl=h1ortl=h3ortl=h5orbl=.orbl=h9orbl=h5thenlo=lt:goto900
1103 iftl=h2andbl=h2then900
1110 iftl=h7orbl=h7then1300
1115 iftl=h8orbl=h8then3500
1120 iftl=h6orbl=h6then1400
1130 iftl=h4orbl=h4thenrp=rp-1:goto1200
1135 iftl=p6ortl=p7ortl=p8orbl=p8then3100
1140 goto900
1199 rem: ***candy pickup
1200 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
1210 pokesh,150:pokewf,33:forl=1to25:next
1220 pokesh,200:forl=1to25:next:pokewf,32:goto900
1299 rem: ***flubug collision
1300 pokelo,37:pokelo+q2,38:pokelo+cm,3:pokelo+cm+q2,3
1310 pokesl,150:forl=1to5:pokewf,17:pokesh,25:forx=1to30:next:pokewf,16
1320 pokewf,33:forx=1to50:next:pokesl,0:forx=1to200:next:next:pokewf,32
1325 goto2000
1399 rem: ***cola collision (glug-glug)
1400 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
1410 pokesl,150:forl=1to4:pokewf,17:pokesh,25:forx=1to15:next:pokewf,16
1412 forx=1to25:next:pokesl,0:forx=1to200:next:next
1415 pokelo,32:pokelo+q2,32:pokelo+cm,1:pokelo+cm+q2,1
1416 aa=int(rnd(1)*8)+1:goto1050
1499 rem: ***select & move flubug
1500 d=int(rnd(p)*a)+p
1510 lt=lo:lo=f(d):x=int(rnd(p)*8)+p:ft=f(d)
1515 onxgosub11,12,13,14,15,16,17,18
1634 f(d)=lo
1635 lo=lt:ifpeek(f(d))<>h2andpeek(f(d))<>37andpeek(f(d))<>38thenf(d)=ft
1700 pokeft,h2
1702 iff(d)=loorf(d)=lo+q2thenpokelo+cm,h3:pokelo+cm+q2,h3:goto1310
1710 pokef(d),h7:pokef(d)+cm,7:goto935
2000 pokevl,.:pokesh,.
2001 print"[147][144]he caught the flu from the flu bug and can not go home."
2002 goto2040
2025 print"[147][144] you won!!"
2030 print" ";mid$(tt$,3,2);" minute ";right$(tt$,2)" seconds
2035 [153]" skill level"a
2040 [153]" play again?"
2045 [151]53272,21
2050 [161]a$:[139]a$[178]""[167]2050
2055 [139]a$[178]"y"[167][138]100
2056 [139]a$[179][177]"n"[167]2050
2060 [153]"load":[128]
2999 [143]: ***build spacephone
3000 q[178]sc[170]80:r[178]sc[170]160:[141]6000:[141]7:[151]lo,32:[151]lo[170]q2,32:lo[178]sc[170]918
3002 [153]"open+, ":[153]"-.sys/ ":rp[178]20:[137]900
3099 [143]: ***ring spacephone
3100 lo[178]sc[170]84:[151]lo,37:[151]lo[170]q2,38:[151]lo[170]cm,4:[151]lo[170]cm[170]q2,4
3110 [151]wf,17:[129]l[178]1[164]3:[129]m[178]1[164]50:[151]sh,150:[129]n[178]1[164]13:[130]
3120 [151]sh,0:[130]:[141]7:[129]m[178]1[164]1000:[130]:[141]7:[130]:[151]wf,16
3399 [143]: ***build spaceship
3400 q[178]sc[170]200:r[178]sc[170]440:[141]7:[141]6000:[141]7
3401 [153]" ":[153]" "
3402 lo[178]sc[170]918:[151]lo,37:[151]lo[170]q2,38:[151]lo[170]cm,4:[151]lo[170]cm[170]q2,4
3406 [141]7:[141]3600:[141]7
3408 [153]""[166]20)"open;
3410 gosub7:gosub3600:gosub7
3425 print""spc(19)"[159]@#b
3430 [153][166]17)"<<###<<
3435 printspc(19)"a#c
3440 [141]7:[141]3600:[141]7
3450 [153]""[166]18)"open@###b
3452 printspc(18)"[159]#####
3460 [153][166]13)"open###############
3462 printspc(18)"[159]#####
3470 [153][166]18)"opena###c
3480 gosub7:gosub3600:gosub7
3490 t=sc+343:forb=1to3:poket,h8:pokecm+t,h3:t=t+q3:next:pokesc+387,h2
3492 pokesc+427,h2
3495 pokevl,0:pokesh,0:rp=20:goto900
3499 rem: ***put alien on ramp
3500 tt$=ti$:lo=sc+386:pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
3505 forl=1to1500:next
3510 pokesc+386,32:pokesc+426,32:pokesc+384,32:pokesc+343,32:pokesc+425,32
3520 forl=1to2000:next:goto2025
3599 rem: ***spaceship sound
3600 pokevl,15:pokewf,33:forl=1to3:form=1to255step2:pokesh,m:next:gosub7:next
3640 pokewf,32:return
4000 x=int(rnd(1)*740)+sc+3*q2:return
5999 rem: ***relocate flubugs
6000 fori=ptoa:iff(i)>qandf(i)<rthenpokef(i),h2:f(i)=f(i)+280
6022 nexti:gosub7:return
8070 data,,,24,24,,,,255,255,255,255,255,255,255,255,,,,56,56,56,56,56
8075 data36,126,126,60,24,24,24,60,126,189,189,189,189,36,66,66
8080 data,,31,127,127,255,255,255,,,248,240,224,192,128,,254,253,248,240,224
8085 data192,128,,,,128,64,32,18,9,6,63,33,63,63,43,53,235,63
8090 data7,31,63,127,127,255,255,255,255,255,255,127,127,63,31,7
8092 data224,248,252,254,254,255,255,255,255,255,255,254,254,252,248,224
8093 data,,,255,255,255,,